package cn.fintecher.pangolin.entity.mysql;

import cn.fintecher.pangolin.common.enums.BaseSelect;
import cn.fintecher.pangolin.common.enums.ConfigState;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import java.util.Set;

/**
 * @Auther: xiaqun
 * @Description: 跟进联络配置实体
 * @Date: 9:48 2019/9/12
 */

@Data
@Entity
@Table(name = "contact_config")
@ApiModel(value = "跟进联络配置实体", description = "跟进联络配置实体")
public class ContactConfig extends BaseEntity {
    @ApiModelProperty(value = "父级ID")
    private String parent;

    @ApiModelProperty(value = "名称")
    private String name;

    @ApiModelProperty(value = "级别")
    private Integer level;

    @ApiModelProperty(value = "是否可扩展")
    @Enumerated(EnumType.STRING)
    private BaseSelect isExtension;

    @ApiModelProperty(value = "委托方ID")
    private String principalId;

    @ApiModelProperty(value = "委托方名称")
    private String principalName;

    @ApiModelProperty(value = "排序")
    private Integer sort;

    @ApiModelProperty(value = "是否录入催记")
    @Enumerated(EnumType.STRING)
    private BaseSelect isRecord;

    @ApiModelProperty(value = "是否必输")
    @Enumerated(EnumType.STRING)
    private BaseSelect isNecessary;

    @ApiModelProperty(value = "字数限制")
    private Integer limitNumber;

    @ApiModelProperty(value = "系统映射属性名")
    private String attribute;

    @ApiModelProperty(value = "系统映射属性类型")
    private String propertyType;

    @ApiModelProperty(value = "值对应的显示的数据,例如承诺还款，承诺日期，已还款，已还款日期")
    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
    @JoinColumn(name = "hide_id")
    private Set<ContactConfig> hideList;

    @ApiModelProperty("状态-disable的数据是用于每添加一个委托方时，新增相应的字段")
    @Enumerated(EnumType.STRING)
    private ConfigState configState;

    @Enumerated(EnumType.STRING)
    @ApiModelProperty(value = "是否为内置数据")
    private BaseSelect isInitData = BaseSelect.NO;

    @ApiModelProperty("数据类型")
    private String fieldDataType;

}
